package rad.framework.mda.navigator.provider;

import rad.framework.mda.navigator.Activator;

import org.eclipse.core.commands.operations.IOperationHistory;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl;
import org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl;
import org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory;

/**
 * @author boudyacho
 *
 */
public class EditingDomainFactory extends DiagramEditingDomainFactory {

	/* (non-Javadoc)
	 * @see org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory#createEditingDomain(org.eclipse.core.commands.operations.IOperationHistory)
	 */
	public TransactionalEditingDomain createEditingDomain(IOperationHistory history) {
		WorkspaceCommandStackImpl stack = new WorkspaceCommandStackImpl(history);
		TransactionalEditingDomain result = new TransactionalEditingDomainImpl(Activator.getDefault().getItemProvidersAdapterFactory(),stack);
		mapResourceSet(result);
		configure(result);
		return result;
	}

	
}
